<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <title>坚果订单查询</title>
    <link rel="icon" href="favicon.ico" type="image/x-icon"/>
<#include "../template/template_editPage.ftl">
<#include "../template/include/assign.ftl">
<#include "../template/include/source.ftl">
    <link href="${web_static}/admin/css/list.css" rel="stylesheet" type="text/css"/>
    <style type="text/css">
        .page {
            float: right;
            padding-top: 15px;
            margin-right: 15px;
        }
    </style>

</head>
<body class="list">
<script type="text/javascript">
    $().ready(function () {

        var $validateErrorContainer = $("#validateErrorContainer");
        var $validateErrorLabelContainer = $("#validateErrorContainer ul");
        var $validateForm = $("#inputForm");
        var $tab = $("#tab");
        // Tab效果
        $tab.tabs(".tabContent", {
            tabs:"input"
        });

        // 表单验证
        $validateForm.validate({
            errorContainer:$validateErrorContainer,
            errorLabelContainer:$validateErrorLabelContainer,
            wrapper:"li",
            errorClass:"validateError",
            ignoreTitle:true,
            rules:{
                "nutsNetOrderQuery.ptOrderNo":{
                    required:true
                }

            },
            messages:{
                "nutsNetOrderQuery.ptOrderNo":{
                    required:"手拉手订单编号为必选项！"
                }

            },
            submitHandler:function (form) {
                //$(form).find(":submit").attr("disabled", true);
                    form.submit();
            }
        });
    <#if actionErrors?? && (actionErrors?size > 0)>
        $.messager.show("提示信息", "<#list errorMessages as list>${list}<br></#list>", 2000);
        $("#span").html("<#list errorMessages as list>${list}<br></#list>");
    </#if>

    });
/*
    function checkOrder() {
        var reg = /^[1-9][0-9]*$/;
        var orderId = $("#orderId").val();
        if (!reg.test(orderId)) {
            $("#orderSpan").html('订单编号只能为数字！');
            return false;
        }
        else {
            $("#orderSpan").html('');
            return true;
        }
    }*/


</script>
<div class="body">
    <div class="listBar">
        <h1><span class="icon">&nbsp;</span>坚果订单查询&nbsp;</h1>
    </div>
    <div style="display: none;" id="validateErrorContainer" class="validateErrorContainer">
        <div class="validateErrorTitle" id="validateErrorTitle">以下信息填写有误,请重新填写</div>
        <ul></ul>
    </div>
    <form id="inputForm" class="validate" action="${web_base}/game/nuts_net!orderList.htm" query="nutsNetOrderQuery"
          method="post">
        <div class="operateBar">
            <label>请输入:</label>
            手拉手订单编号：<input type="text" id="orderId"  name="nutsNetOrderQuery.ptOrderNo"
                           value="<#if nutsNetOrderQuery??>${(nutsNetOrderQuery.ptOrderNo)!}</#if>"  onkeyup="this.value=this.value.replace(/\D/g,'')"
                           onafterpaste="this.value=this.value.replace(/\D/g,'')"/>*
            <span id="orderSpan" style="color: red;"></span>
            坚果订单编号：<input type="text" name="nutsNetOrderQuery.supOrderNo"
                          value="<#if nutsNetOrderQuery??>${(nutsNetOrderQuery.supOrderNo)!}</#if>" onkeyup="this.value=this.value.replace(/\D/g,'')"
                          onafterpaste="this.value=this.value.replace(/\D/g,'')"/>
            <input type="submit" id="searchButton" class="addButton" value="查询"/>

        </div>
    </form>
    <table class="listTable">
        <tr>
            <th>
                <span class="sort" name="ptOrderNo">手拉手订单编号</span>
            </th>
            <th>
                <span class="sort" name="status">状态</span>
            </th>
            <th>
                <span class="sort" name="statusDetail">状态描述</span>
            </th>
            <th>
                <span class="sort" name="supOrderNo">坚果订单编号</span>
            </th>
            <th>
                <span class="sort" name="supOrderSuccessTime">坚果充值成功时间</span>
            </th>
            <th>
                <span class="sort" name="supOrderDetail">坚果返回卡密信息</span>
            </th>
        <#--<th>
            <span class="sort" name="failedCode"> 失败代码</span>
        </th>
        <th>
            <span class="sort" name="failedReason"> 失败原因</span>
        </th>-->
        </tr>
    <#if nutsNetOrder??>
        <tr>
            <td>
            ${(nutsNetOrder.ptOrderNo)!}
            </td>
            <td>
            ${(nutsNetOrder.status)!}
            </td>
            <td>
                <#if nutsNetOrder?? && nutsNetOrder.status == "ORDER_SUCCESS">
                    订单充值成功
                <#elseif  nutsNetOrder?? && nutsNetOrder.status == "ORDER_FAILED">
                    订单充值失败
                <#elseif  nutsNetOrder?? && nutsNetOrder.status == "ORDER_UNDERWAY">
                    订单处理中
                <#elseif  nutsNetOrder?? && nutsNetOrder.status == "REQUEST_FAILED">
                    请求失败
                <#elseif  nutsNetOrder?? && nutsNetOrder.status == "ORDER_NOT_EXIST">
                    订单不存在
                </#if>
            </td>
            <td>
            ${(nutsNetOrder.supOrderNo)!}
            </td>
            <td>
            ${(nutsNetOrder.supOrderSuccessTime)!}
            </td>
            <td>
            ${(nutsNetOrder.supOrderDetail)!}
            </td>
            <#if nutsNetOrder.failedCode??>
            <#--<td>
            ${(nutsNetOrder.failedCode)!}
            </td>
            <td>
            ${(nutsNetOrder.failedReason)!}
            </td>-->
            </#if>
        </tr>
    </#if>
    </table>
<#if !nutsNetOrder??>
<div class="noRecord">
    <span id="span"> 没有找到任何记录!</span>
</#if>
</div>
</div>

</body>
</html>